body {
    font-family: 'Arial', sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 20px;
    background-color: #f5f5f5;
}

.container {
    max-width: 600px;
    margin: 0 auto;
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

h1 {
    text-align: center;
    color: #333;
    margin-bottom: 30px;
}

/* 资源池选择器 */
.pool-selector {
    text-align: center;
    margin-bottom: 20px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 8px;
}

.pool-selector select {
    padding: 8px 15px;
    border-radius: 5px;
    border: 1px solid #ddd;
    background-color: white;
    font-size: 14px;
}

/* 资源状态栏 */
.resources-bar {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-bottom: 15px;
}

/* 资源部分 */
.resources-section {
    flex: 1;
    min-width: 150px;
    max-width: 300px;
    background: #f8f9fa;
    border-radius: 8px;
    padding: 10px;
    margin: 0 5px;
}

.resources-section h3 {
    font-size: 14px;
    margin: 0 0 8px 0;
    color: #666;
    text-align: center;
}

.resources-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-bottom: 5px;
}

.resource-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: white;
    padding: 4px 8px;
    border-radius: 12px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
    transition: transform 0.2s ease;
    margin: 2px;
}

.resource-item:hover {
    transform: translateY(-2px);
}

.resource-icon {
    font-size: 16px;
}

.resource-amount {
    font-weight: bold;
    font-size: 15px;
}

.resource-name {
    font-size: 13px;
    color: #666;
}

/* 兼容旧版UI */
.player-stats {
    display: flex;
    justify-content: space-around;
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.stat {
    text-align: center;
}

.label {
    display: block;
    font-size: 14px;
    color: #666;
}

.value {
    display: block;
    font-size: 24px;
    font-weight: bold;
    color: #e74c3c;
}

/* 投资网格布局 */
.investment-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 15px;
}

.sliders-column {
    flex: 3;
    min-width: 200px;
}

.preview-column {
    flex: 2;
    min-width: 120px;
    display: flex;
    align-items: stretch;
}

.preview-column .investment-preview {
    width: 100%;
    margin: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* 资源滑块 */
.resource-slider {
    margin-bottom: 10px;
    padding: 8px;
    background: #f8f9fa;
    border-radius: 8px;
}

.resource-label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 5px;
    font-size: 14px;
}

.slider-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.slider-row input[type="range"] {
    flex: 1;
}

.slider-value {
    font-weight: bold;
    min-width: 20px;
    text-align: center;
}

/* 投资预览 */
.investment-preview {
    margin: 20px 0;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    text-align: center;
}

.investment-preview h4 {
    margin-bottom: 10px;
    color: #333;
}

.preview-info p {
    margin: 5px 0;
    color: #555;
}

/* 结果网格布局 */
.result-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
    margin-bottom: 15px;
}

/* 返还阶段样式 */
.return-section {
    margin-bottom: 15px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
}

.return-section h3 {
    font-size: 15px;
    margin-bottom: 10px;
    color: #333;
    text-align: center;
}

.resources-display {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-bottom: 10px;
}

.multiplier-badge, .return-rate-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
    color: white;
    background-color: #3498db;
    margin-left: 5px;
}

.multiplier-details {
    font-size: 14px;
    color: #666;
    text-align: center;
}

/* 结果阶段样式 */
.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.result-header h2 {
    margin: 0;
}

.round-info {
    text-align: right;
}

.round-badge {
    display: inline-block;
    padding: 4px 10px;
    background: #3498db;
    color: white;
    border-radius: 15px;
    font-size: 14px;
    font-weight: 500;
}

.resources-change {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 15px;
}

.player-result, .ai-result {
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    transition: transform 0.2s ease;
}

.player-result:hover, .ai-result:hover {
    transform: translateY(-2px);
}

.player-result h3, .ai-result h3 {
    font-size: 15px;
    margin-top: 0;
    margin-bottom: 10px;
    color: #333;
}

.next-round-container {
    text-align: center;
    margin: 10px 0;
}

.next-round-info {
    font-size: 14px;
    color: #666;
    font-style: italic;
    animation: pulse 1.5s infinite;
}

.phase {
    display: none;
    padding: 20px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    margin-bottom: 20px;
}

.phase.active {
    display: block;
    border-color: #3498db;
}

.input-group {
    margin-bottom: 20px;
}

input[type="range"] {
    width: 100%;
    margin: 10px 0;
}

button {
    background: #3498db;
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    display: block;
    margin: 20px auto;
}

button:hover {
    background: #2980b9;
}

.result-info, .final-result {
    text-align: center;
    font-size: 18px;
}

.next-round-info {
    text-align: center;
    font-style: italic;
    color: #666;
    margin-top: 15px;
}

.history-container {
    margin: 20px 0;
    max-height: 300px;
    overflow-y: auto;
}

#historyTable {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

#historyTable th, #historyTable td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: center;
}

#historyTable th {
    background-color: #f2f2f2;
    position: sticky;
    top: 0;
}

#historyTable tr:nth-child(even) {
    background-color: #f9f9f9;
}

.chart-container {
    height: 200px;
    border: 1px solid #ddd;
    margin: 15px 0;
    padding: 10px;
    background: #f9f9f9;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.text-chart {
    width: 100%;
}

.chart-row {
    margin: 10px 0;
    display: flex;
    align-items: center;
}

.chart-row strong {
    min-width: 120px;
    text-align: right;
    margin-right: 10px;
}

.chart-bar {
    display: inline-block;
    height: 20px;
    background-color: #3498db;
    color: white;
    text-align: center;
    line-height: 20px;
    margin-right: 5px;
    border-radius: 3px;
    font-size: 12px;
}

.ai-bar {
    background-color: #e74c3c;
}

.deception-round {
    background-color: #fff0f0;
}

.action-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
}

/* 动画类、状态渐变已移至 animations/animations.css */

/* 导航链接样式 */
.nav-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    background-color: #f8f9fa;
    color: #3498db;
    text-decoration: none;
    border-radius: 5px;
    border: 1px solid #e0e0e0;
    font-weight: 500;
    margin: 0 5px;
    transition: all 0.2s ease;
}

.nav-link:hover {
    background-color: #edf2f7;
    color: #2980b9;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.nav-link:active {
    transform: translateY(1px);
}

.nav-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
}

/* 面包屑导航 */
.breadcrumb {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    align-items: center;
    font-size: 14px;
    color: #666;
}

.breadcrumb a {
    color: #3498db;
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.breadcrumb .separator {
    color: #999;
}

/* 投资滑块美化 */
input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 10px;
    border-radius: 5px;
    background: #ddd;
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 25px;
    height: 25px;
    border-radius: 50%;
    background: #3498db;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 0 5px rgba(0,0,0,0.2);
}

input[type="range"]::-moz-range-thumb {
    width: 25px;
    height: 25px;
    border-radius: 50%;
    background: #3498db;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 0 5px rgba(0,0,0,0.2);
}

input[type="range"]:hover::-webkit-slider-thumb {
    background: #2980b9;
}

input[type="range"]:hover::-moz-range-thumb {
    background: #2980b9;
}

.ai-strategy {
    text-align: center;
    margin-top: 20px;
    padding: 15px;
    background: #ecf0f1;
    border-radius: 8px;
}

select {
    padding: 8px;
    border-radius: 5px;
    border: 1px solid #bdc3c7;
}

/* 移动端响应式布局（保留PC兼容） */
@media (max-width: 768px) {
    body {
        padding: 5px;
        margin: 0;
    }

    .container {
        padding: 10px;
        border-radius: 8px;
        box-shadow: none;
        max-width: 100%;
        width: 100%;
        box-sizing: border-box;
    }
    
    h1 {
        font-size: 24px;
        margin-bottom: 15px;
    }
    
    h2 {
        font-size: 20px;
    }
    
    h3 {
        font-size: 16px;
    }

    /* 导航链接紧凑化 */
    .nav-links {
        gap: 5px;
    }
    
    .nav-link {
        padding: 6px 12px;
        font-size: 14px;
    }
    
    /* 资源部分紧凑化 */
    .resources-section {
        margin-bottom: 10px;
    }
    
    .resources-section h3 {
        margin-bottom: 5px;
    }
    
    .resources-container {
        gap: 8px;
        margin-bottom: 5px;
        flex-wrap: wrap;
    }
    
    .resource-item {
        padding: 5px 10px;
        font-size: 14px;
    }
    
    .resource-icon {
        font-size: 16px;
    }
    
    /* 资源池选择器紧凑化 */
    .pool-selector {
        padding: 8px;
        margin-bottom: 10px;
    }
    
    .pool-selector select {
        width: 100%;
    }

    /* 玩家状态紧凑化 */
    .player-stats {
        flex-direction: column;
        gap: 5px;
        padding: 8px;
        margin-bottom: 10px;
    }

    .value {
        font-size: 18px;
    }
    
    /* 投资阶段紧凑化 */
    .phase {
        padding: 12px;
        margin-bottom: 15px;
    }
    
    .input-group {
        margin-bottom: 10px;
    }
    
    .resource-slider {
        padding: 8px;
        margin-bottom: 10px;
    }
    
    .investment-preview {
        margin: 10px 0;
        padding: 10px;
    }
    
    /* 返还阶段紧凑化 */
    .return-section {
        margin-bottom: 15px;
        padding: 10px;
    }
    
    .resources-display {
        gap: 8px;
    }
    
    /* 结果阶段紧凑化 */
    .resources-change {
        gap: 10px;
    }
    
    .player-result, .ai-result {
        padding: 10px;
    }

    /* 按钮紧凑化 */
    button {
        width: 100%;
        padding: 10px;
        font-size: 16px;
        margin: 15px auto;
    }

    .result-info, .final-result {
        font-size: 14px;
    }
    
    /* 历史表格紧凑化 */
    .history-container {
        max-height: 250px;
    }
    
    #historyTable th, #historyTable td {
        padding: 6px 4px;
        font-size: 13px;
    }
    
    /* 图表紧凑化 */
    .chart-container {
        height: 150px;
    }
}

/* 小屏幕手机特别优化 */
@media (max-width: 480px) {
    body {
        padding: 0;
    }
    
    .container {
        padding: 8px;
        border-radius: 0;
    }
    
    .resources-section {
        min-width: 100px;
        max-width: none;
        margin: 0 2px;
    }
    
    h1 {
        font-size: 20px;
        margin-bottom: 10px;
    }
    
    /* 导航链接单行滚动 */
    .nav-links {
        overflow-x: auto;
        white-space: nowrap;
        padding-bottom: 5px;
        justify-content: flex-start;
    }
    
    /* 资源显示紧凑排列 */
    .resource-item {
        padding: 3px 6px;
        font-size: 11px;
        margin: 1px;
    }
    
    .resource-icon {
        font-size: 12px;
    }
    
    .resources-container {
        gap: 4px;
    }
    
    /* 极简模式 - 隐藏次要信息 */
    .multiplier-details p:not(:first-child) {
        display: none;
    }
    
    /* 结果页面垂直堆叠 */
    .player-result, .ai-result {
        flex: none;
        width: 100%;
    }
}

/* 玩法介绍模态框 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    background-color: white;
    margin: 5% auto;
    padding: 20px;
    border-radius: 15px;
    width: 80%;
    max-width: 800px;
    box-shadow: 0 5px 30px rgba(0,0,0,0.3);
    max-height: 85vh;
    overflow-y: auto;
    animation: modalFadeIn 0.3s ease-out;
}

@keyframes modalFadeIn {
    from { opacity: 0; transform: translateY(-30px); }
    to { opacity: 1; transform: translateY(0); }
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 25px;
    color: #333;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s;
}

.close-modal:hover {
    color: #007bff;
}

/* 教程导航 */
.tutorial-nav {
    display: flex;
    justify-content: space-between;
    margin: 20px 0;
    border-radius: 10px;
    overflow: hidden;
    background-color: #f8f9fa;
}

.tutorial-step {
    flex: 1;
    text-align: center;
    padding: 12px 5px;
    cursor: pointer;
    position: relative;
    transition: background-color 0.3s;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.tutorial-step .step-number {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background-color: #007bff;
    color: white;
    margin-bottom: 8px;
    font-weight: bold;
}

.tutorial-step .step-title {
    font-size: 14px;
    font-weight: 500;
}

.tutorial-step.active {
    background-color: #007bff;
    color: white;
}

.tutorial-step.active .step-number {
    background-color: white;
    color: #007bff;
}

.tutorial-step.completed .step-number {
    background-color: #28a745;
}

/* 教程内容 */
.tutorial-content-container {
    margin: 20px 0;
    min-height: 300px;
}

.tutorial-content {
    display: none;
    animation: contentFadeIn 0.4s ease-out;
}

.tutorial-content.active {
    display: block;
}

@keyframes contentFadeIn {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}

.tutorial-info {
    line-height: 1.6;
}

.tutorial-info p {
    margin-bottom: 15px;
}

.tutorial-info strong {
    color: #007bff;
    font-weight: 600;
}

.tutorial-image {
    margin: 20px 0;
    text-align: center;
}

.tutorial-image img {
    max-width: 100%;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

/* 资源和AI策略说明 */
.resource-explanation {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    padding: 10px;
    border-radius: 10px;
    background-color: #f8f9fa;
    transition: transform 0.2s;
}

.resource-explanation:hover {
    transform: translateX(5px);
}

.resource-explanation .resource-icon {
    font-size: 24px;
    margin-right: 15px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background-color: #f0f0f0;
}

.resource-details h4 {
    margin: 0 0 5px 0;
    font-size: 18px;
}

.resource-details p {
    margin: 0;
    font-size: 14px;
}

.ai-strategy-explanation {
    margin-bottom: 15px;
    padding: 10px;
    border-left: 3px solid #007bff;
    background-color: #f8f9fa;
}

.ai-strategy-explanation h4 {
    margin: 0 0 5px 0;
}

.ai-strategy-explanation p {
    margin: 0;
    font-size: 14px;
}

/* 导航按钮 */
.tutorial-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e9e9e9;
}

.tutorial-navigation button {
    padding: 10px 20px;
    border: none;
    border-radius: 20px;
    background-color: #007bff;
    color: white;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.tutorial-navigation button:hover {
    background-color: #0069d9;
    transform: translateY(-2px);
}

.tutorial-navigation button:disabled {
    background-color: #e9e9e9;
    color: #999;
    cursor: not-allowed;
    transform: none;
}

#startPlaying {
    background-color: #28a745;
}

#startPlaying:hover {
    background-color: #218838;
}

/* 移动设备适配 */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        margin: 10% auto;
        padding: 15px;
    }
    
    .tutorial-nav {
        flex-wrap: wrap;
    }
    
    .tutorial-step {
        flex-basis: 33.33%;
        padding: 8px 2px;
    }
    
    .tutorial-step .step-title {
        font-size: 12px;
    }
}